﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NetfractionHub.Network.Protocol.BASE.Factory
{
    public class FactorySID : ProtocolMessageFactory
    {
        public enum ParameterEnum : int
        {
            SessionId = 1
        }

        // pass list of strings as object to overcome limitations of the keys i.e. can only have one AD and one RM object otherwise
        public override ProtocolMessage Create(ProtocolMessage.MessageTypeEnum messageType, Dictionary<int, object> parameters)
        {
            ProtocolMessage proto = new ProtocolMessage(messageType, ProtocolFeatureBASE.FeatureActions.ActionSID);

            if (parameters.Count > 0)
            {
                proto.Parameters.Add(new ProtocolParameter(parameters[(int)ParameterEnum.SessionId].ToString()));
            }
            
            return proto;
        }
    }
}
